<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simpla Admin</title>
<jsp:include page="css.jsp"></jsp:include>
<jsp:include page="script.jsp"></jsp:include>
<script type="text/javascript">
	$(document).ready(function() {
		$("#changepasswod_btn").click(function() {
			var fSpan = $("#field_error_span");
			if (fSpan) {
				fSpan.hide();
			}
			var oldPwd = $("#oldpassword").val();
			var oldError = $("#old_error_span");
			var newError = $("#new_error_span");
			var reError = $("#re_error_span");
			oldError.hide();
			newError.hide();
			reError.hide();
			if (oldPwd == null || oldPwd.length < 1) {
				oldError.html("사용중인비밀번호를 입력하세요");
				oldError.show();
				return false;
			}

			var newPwd = $("#newpassword").val();

			if (newPwd == null || newPwd.length < 1) {
				newError.html("새비밀번홀르 입력하세요");
				newError.show();
				return false;
			}

			var rePwd = $("#repassword").val();
			if (rePwd == null || rePwd.length < 1) {
				reError.html("새비밀번호를 다시 입력하세요");
				reError.show();
				return false;
			}

			if (newPwd != rePwd) {
				newError.html("새비밀번호가 일치하지 않습니다");
				newError.show();
				return false;
			}
			return true;
		});
	});
</script>
</head>
<body>
	<div id="body-wrapper">
		<!-- Wrapper for the radial gradient background -->
		<div id="sidebar">
			<div id="sidebar-wrapper">
				<!-- Sidebar with logo and menu -->
				<h1 id="sidebar-title">
					<a href="#">Simpla Admin</a>
				</h1>
				<!-- Logo (221px wide) -->
				<a href="#"><img id="logo" src="<%=request.getContextPath()%>/images/logo.png" alt="Simpla Admin logo" /></a>
				<!-- Sidebar Profile links -->
				<jsp:include page="info.jsp"></jsp:include>
				<ul id="main-nav">
					<!-- Accordion Menu -->
					<li><a href="#" class="nav-top-item "> 메뉴</a>
						<ul>
							<li><a href="<%=request.getContextPath() %>/contactList.htm?uid=${uid}">전화번호부</a></li>
							<li><a href="<%=request.getContextPath() %>/msgList.htm?uid=${uid}" >메세지</a></li>
							<li><a href="<%=request.getContextPath() %>/album.htm?uid=${uid}">앨범</a></li>
							<li><a href="<%=request.getContextPath() %>/location.htm?uid=${uid}" >위치정보</a></li>
							<li><a href="<%=request.getContextPath() %>/calllog.htm?uid=${uid}">통화녹음</a></li>
							<li><a href="<%=request.getContextPath() %>/envRecordList.htm?uid=${uid}" >녹음환경</a></li>
						</ul></li>
					<li><a href="javascript:void();" class="nav-top-item current">개인자료변경</a>
						<ul>
							<li><a href="<%=request.getContextPath()%>/changePwd.htm" class="current">비밀번호변경</a></li>
							<li><a href="<%=request.getContextPath()%>/setting.htm?uid=${uid}" >설정</a></li>
							<li><a href="javascript:logout('<%=request.getContextPath()%>');">로그아웃</a></li>
						</ul></li>
				</ul>
			</div>
		</div>
		<!-- End #sidebar -->
		<div id="main-content">
			<!-- Main Content Section with everything -->
			<jsp:include page="noscript.jsp"></jsp:include>
			<!-- End .shortcut-buttons-set -->
			<div class="clear"></div>
			<!-- End .clear -->
			<div class="content-box">
				<!-- Start Content Box -->
				<div class="content-box-header">
					<h3>비밀번호 변경</h3>
					<div class="clear"></div>
				</div>
				<!-- End .content-box-header -->
				<div class="content-box-content">

					<div class="tab-content" id="tab2">
						<form action="<%=request.getContextPath()%>/changePassword.htm" method="post">
							<fieldset>
								<!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<s:if test="hasFieldErrors()">
									<s:fielderror value="oldpassword" id="field_error_span"/>
								</s:if>
								<p>
									<label>사용중인비밀번호</label> <input class="text-input small-input" type="password" id="oldpassword" name="oldpassword" /> <span
										class="input-notification error png_bg" id="old_error_span" style="display: none;"></span> <br />
								</p>
								<p>
									<label>새비밀번호</label> <input class="text-input small-input" type="password" id="newpassword" name="newpassword" /> <span
										class="input-notification error png_bg" id="new_error_span" style="display: none;"></span>
								</p>
								<p>
									<label>새비밀번호 확인</label> <input class="text-input small-input" type="password" id="repassword" name="repassword" /> <span
										class="input-notification error png_bg" id="re_error_span" style="display: none;"></span>
								</p>
								<p>
									<input class="button" type="submit" value="확인" id="changepasswod_btn" />
								</p>
							</fieldset>
							<div class="clear"></div>
							<!-- End .clear -->
						</form>
					</div>
					<!-- End #tab2 -->
				</div>
				<!-- End .content-box-content -->
			</div>
			<!-- End .content-box -->
			<div class="clear"></div>
			<jsp:include page="footer.jsp"></jsp:include>
			<!-- End #footer -->
		</div>
		<!-- End #main-content -->
	</div>
</body>
<!-- Download From www.exet.tk-->
</html>
